<?php
namespace Android\Controller;
use Think\Controller;
class CardController extends Controller {
     //会员卡的查找
      public function find(){
    	  $info=M('card');
          $user_id=$_POST['user_id'];
          $infos=$info->where("user_id=".$user_id." and is_pocket=1")->select();
         echo json_encode($infos);
       }   
       //会员卡添加 
      public function add(){
    	  $info=M('card');
          $data=$info->create();
         $success= $info->data($data)->add();
         if($success){
         	echo "1";
         }else{
         	echo "0";
         }
       }
    //根据类型得到vip卡片
    public function  VIP(){
        $card= D('card');
        $type=$_POST['type'];
        $info=  $card->VIP($type);
       echo json_encode($info);
    }


       
}
